from flask import Flask, render_template

from Controller.FileManager import FileManager
from Controller.ConfigData import configData
from Controller.ListData import listData
from Controller.ButtonAdd import Add
from Controller.ButtonEdit import Edit
from Controller.ButtonDelete import Delete
from Controller.SetGray import SetGray
from Controller.StartImages import StartImage

app = Flask(__name__)
app.register_blueprint(configData)
app.register_blueprint(listData)
app.register_blueprint(Add)
app.register_blueprint(Edit)
app.register_blueprint(Delete)
app.register_blueprint(SetGray)
app.register_blueprint(StartImage)
app.register_blueprint(FileManager)

app.config.update(RESTFUL_JSON=dict(ensure_ascii=False))
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://cloud:mysql@47.93.162.110:3306/cloud'


# web服务
@app.route('/')
def index():
    return render_template('index.html')


@app.route('/dk')
def default():
    return render_template('kq/default.html')


@app.route('/kq')
def kq():
    return render_template('kq/index.html')


@app.route('/kqzz')
def kqzz():
    return render_template('kq/indexzz.html')


@app.route('/sign')
def sign():
    return render_template("sign/sign.html")
@app.route('/jsapi')
def jsapi():
    return render_template("jsapi/apitest.html")
@app.route('/upload')
def upload():
    return render_template('upload.html')

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=8088)
